Post

Replies

Boosts

Views

Activity

Reply to When to tell system to show PlaceHolderView in Widget with Xcode Beta3
I found answer for this in another thread made by apple engineer. https://developer.apple.com/forums/thread/655182?answerId=623062022#623062022 You should implement placeholder(with: Context) to return a TimelineEntry that contains whatever you need for your placeholder. Note that unlike snapshot and timeline which are asynchronous with a completion block, the placeholder method is synchronous and you return a timeline entry immediately. So you want to be fast to return that entry.   When your widget's view is rendered for placeholder purposes it's given the placeholder entry and you can render your view accordingly. Note, there's some new SwiftUI support for marking a view as redacted. What should happen is that when WidgetKit renders the widget's view using the placeholder timeline entry, it would automatically render the view using .redacted(reason: .placeholder). Unfortunately that isn't working in Beta 3, but should be fixed in an upcoming seed.  Hope this helps. 😊
Jul ’20